package cn.rengy.web.framework.transcode.service;

import java.util.List;
import java.util.Map;
import java.util.concurrent.Callable;

import javax.annotation.Resource;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.cache.Cache;
import org.springframework.cache.Cache.ValueWrapper;
import org.springframework.cache.CacheManager;
import org.springframework.stereotype.Service;

import cn.rengy.web.framework.cache.CacheService;
import cn.rengy.web.framework.data.transcode.TranscodeColumn;
import cn.rengy.web.framework.sql.DbService;


@Service
public class TranscodeService {
	@Autowired
	private DbService dbService;
	@Autowired
	private CacheService cacheService;
	
	//@Cacheable(value="trancodeCache",key="#transCodeKey")
	public List<TranscodeColumn> getTrancodeColumn(String transCodeKey){
		return cacheService.getLocalCacheIncludeNull("transCodeCache", transCodeKey, new Callable<List<TranscodeColumn>>() {
			@Override
			public List<TranscodeColumn> call() throws Exception {
				List<TranscodeColumn> list = dbService.queryForBeanList("select_transcode_bykey", TranscodeColumn.class, transCodeKey);
				return list;
			}
		});
	}
	
	
	
}
